package com.cl.short_video_java.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import lombok.Data;

/**
 * 系统访问记录
 *
 * @TableName sys_logininfor
 */
@TableName(value = "sys_logininfor")
@Data
public class SysLogininfor implements Serializable {
	/**
	 * 访问ID
	 */
	@TableId(type = IdType.AUTO)
	private Long infoId;

	/**
	 * 用户账号
	 */
	private String userName;

	/**
	 * 登录IP地址
	 */
	private String ipaddr;

	/**
	 * 登录地点
	 */
	private String loginLocation;

	/**
	 * 浏览器类型
	 */
	private String browser;

	/**
	 * 操作系统
	 */
	private String os;

	/**
	 * 登录状态（0成功 1失败）
	 */
	private Integer status;

	/**
	 * 提示消息
	 */
	private String msg;

	/**
	 * 访问时间
	 */
	private Date loginTime;

	@TableField(exist = false)
	private static final long serialVersionUID = 1L;

	@Override
	public boolean equals(Object that) {
		if (this == that) {
			return true;
		}
		if (that == null) {
			return false;
		}
		if (getClass() != that.getClass()) {
			return false;
		}
		SysLogininfor other = (SysLogininfor) that;
		return (this.getInfoId() == null ? other.getInfoId() == null : this.getInfoId().equals(other.getInfoId()))
				&& (this.getUserName() == null ? other.getUserName() == null : this.getUserName().equals(other.getUserName()))
				&& (this.getIpaddr() == null ? other.getIpaddr() == null : this.getIpaddr().equals(other.getIpaddr()))
				&& (this.getLoginLocation() == null ? other.getLoginLocation() == null : this.getLoginLocation().equals(other.getLoginLocation()))
				&& (this.getBrowser() == null ? other.getBrowser() == null : this.getBrowser().equals(other.getBrowser()))
				&& (this.getOs() == null ? other.getOs() == null : this.getOs().equals(other.getOs()))
				&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
				&& (this.getMsg() == null ? other.getMsg() == null : this.getMsg().equals(other.getMsg()))
				&& (this.getLoginTime() == null ? other.getLoginTime() == null : this.getLoginTime().equals(other.getLoginTime()));
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((getInfoId() == null) ? 0 : getInfoId().hashCode());
		result = prime * result + ((getUserName() == null) ? 0 : getUserName().hashCode());
		result = prime * result + ((getIpaddr() == null) ? 0 : getIpaddr().hashCode());
		result = prime * result + ((getLoginLocation() == null) ? 0 : getLoginLocation().hashCode());
		result = prime * result + ((getBrowser() == null) ? 0 : getBrowser().hashCode());
		result = prime * result + ((getOs() == null) ? 0 : getOs().hashCode());
		result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
		result = prime * result + ((getMsg() == null) ? 0 : getMsg().hashCode());
		result = prime * result + ((getLoginTime() == null) ? 0 : getLoginTime().hashCode());
		return result;
	}

	@Override
	public String toString() {
		StringBuilder sb = new StringBuilder();
		sb.append(getClass().getSimpleName());
		sb.append(" [");
		sb.append("Hash = ").append(hashCode());
		sb.append(", infoId=").append(infoId);
		sb.append(", userName=").append(userName);
		sb.append(", ipaddr=").append(ipaddr);
		sb.append(", loginLocation=").append(loginLocation);
		sb.append(", browser=").append(browser);
		sb.append(", os=").append(os);
		sb.append(", status=").append(status);
		sb.append(", msg=").append(msg);
		sb.append(", loginTime=").append(loginTime);
		sb.append(", serialVersionUID=").append(serialVersionUID);
		sb.append("]");
		return sb.toString();
	}
}